import { Constructor } from './interfaces';

export function Transform(propertyName?: string, ...pipes: Array<Constructor<any> | object>): PropertyDecorator {
    return function (target: object, propertyKey: string | symbol) {
        Reflect.defineMetadata(
            propertyKey,
            {
                pipes,
                originPropertyName: propertyKey,
                propertyName,
                dto: target.constructor,
            },
            target.constructor,
        );
    };
}
